function FileOpp() {
  var self = this;
  
  var sAjax = 'lib/ajax.php';
  
  this.dropOnItem=function(jDrag, jDrop) {
    drop(jDrag, jDrop.attr('filepath'));
  }
  
  this.dropOnView=function(jDrag, jView) {
    if (jView.attr('showspath') === undefined)
      jView = jView.find('[showspath]');
    drop(jDrag, jView.attr('showspath'));
  }
  
  function drop(jDrag, sDestPath) {
    // jDrag was dropped somewhere with destination path sDestPath,
    // we determine which operation to do by seeing if CTRL is
    // pressed and whether the jDrag is a directory or not:
    var sAction = (CTRL_DOWN?'copy':'move') + 
        ((parseInt(jDrag.attr('filetype')) == TYPE_MAP)?'dir':'file');

    // Then we tell the server to perform the operation via ajax:
    oAjax.doOpp(sAction, jDrag.attr('filepath'),
       sDestPath + '/' + jDrag.attr('filename'),
    function (aData) {
      // We let the user know what the server returned:
      oMenu.setMessage((aData['code']==0), aData['melding']);

      // Then we refresh all relevant views, that's any views showing the jDrop and 
      // subfolders, or showing one level above the jDrag folder and subfolders.
      refresh(sDestPath);
      refresh(jDrag.attr('filepath').substring(0, jDrag.attr('filepath').lastIndexOf('/')));
    });
  }
  
  function refresh(sPath) {
    // Select all views in the tree where the path starts with the path to refresh
    $('#tree [showspath^="'+sPath+'"]').each(function() {
      var jThis = $(this);
      
      // Get the directory with Ajax
      oAjax.getDir(jThis.attr('showspath'), function(aData) {
        // If there's an error we assume the path doesn't exist anymore,
        // so we remove it from the view
        if (aData.code != undefined)
          jThis.remove();
        else // else we replace it with a new view
          jThis.replaceWith(oFileList.getUl(aData, jThis.attr('showspath'), false));
      });
    });
    // Select all views in the columns view where the path starts with the path to refresh
    $('#columns [showspath^="'+sPath+'"]').each(function() {
      var jThis = $(this);
      
      // Get the directory with Ajax
      oAjax.getDir(jThis.attr('showspath'), function(aData) {
        // If there's an error we assume the path doesn't exist anymore, so we
        // remove it from the view, plus any columns that were showing subfolders
        if (aData.code != undefined) {
          oDragSec.delFromColumn(getColNr(jThis));
        } else { // else we replace it with a new view
          oDragSec.updateColumn(jThis, oFileList.getUl(aData, jThis.attr('showspath'), true));
        }
      });
    });
    // Select all views in the list view where the path starts with the path to refresh
    $('#lists [showspath^="'+sPath+'"]').each(function() {
      var jThis = $(this);
      
      // Get the directory with Ajax
      oAjax.getDir(jThis.attr('showspath'), function(aData) {
        // If there's an error we assume the path doesn't exist anymore, so we replace
        // the view with a listing of the highest folder that does still exist (sPath)
        if (aData.code != undefined) {
          oAjax.getDir(sPath, function(aData) {
            oDragSec.setList(oFileList.getTbody(aData, sPath), getListNr(jThis));
          });
        } else { // else we replace it with a new view of the same path
          oDragSec.setList(oFileList.getTbody(aData, jThis.attr('showspath')), getListNr(jThis));
        }
      });
    });
  }
}
